﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DownloadInterface
{
   
    public enum DownloadedFileOperation
    {
        FILE_DELETE,
        FILE_CHANGECATEGORY
    }

    public enum FileCategoryOperation
    {
        CATEGORY_ADD,
        CATEGORY_DELETE,
        CATEGORY_RENAME
    }

    public delegate void operateDowloadTask(DownloadTaskOperation operation);

    public delegate void operateDownloadedFile(DownloadedFileOperation operation);

    public delegate void CategoryChangedEventHandler();

    public delegate void WindowCloseEventHandler();

    public interface IUserInterface
    {
        event operateDowloadTask OperateDownloadTask;

        event operateDownloadedFile OperateDownloadFile;

        event DownloadCompletedEventHandler DownloadCompleted;

        event CategoryChangedEventHandler CategoryChanged;

        event WindowCloseEventHandler WindowClose;

        void displayDownloadTaskList(IEnumerable<DownloadTask> downloadTaskList);

        void displayDownloadedFileList(IEnumerable<DownloadedFile> downloadedFileList);

        void displayDownloadedFileCategory(IEnumerable<FileCategory> categoryList);

        DownloadTask getNewDownloadTask(); // 用于开始新的下载，获取下载的文件名、下载地址等信息

        DownloadTask getCurrentTask(); // 用于对当前选中的下载任务执行暂停、继续、删除操作

        DownloadedFile getCurrentFile();// 用于对当前选中的文件执行删除，改变分类操作

        FileCategory getCurrentCategory();// 用于显示当前分类的文件列表，以及对选中分类的删除、重命名操作

        void handleDownloadCompleted(DownloadTask task);

        void displayDownloadError(string errorDiscription);
    }
}
